<template>
  <dv-border-box-12 class="tech-skill-card">
    <div class="tech-card-header">
      <span class="tech-title">热门技能标签</span>
    </div>
    <div class="skill-tags-container">
      <div v-if="loading" class="loading-container">
        <dv-loading>加载中...</dv-loading>
      </div>
      <div v-else class="skill-tags">
        <el-tag 
          v-for="(tag, index) in skillTags" 
          :key="index"
          :style="{ fontSize: `${tag.size}px`, opacity: tag.opacity }"
          class="skill-tag"
        >
          {{ tag.name }} ({{ tag.count }})
        </el-tag>
      </div>
    </div>
  </dv-border-box-12>
</template>

<script>
export default {
  name: 'SkillTagsCloud',
  props: {
    loading: {
      type: Boolean,
      default: false
    },
    skillTags: {
      type: Array,
      required: true
    }
  }
}
</script>

<style scoped>
.tech-skill-card {
  background-color: rgba(0, 20, 40, 0.7);
  padding: 15px;
  min-height: 150px;
}

.tech-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 0 10px;
}

.tech-title {
  font-size: 18px;
  font-weight: 600;
  color: #00c0ff;
  text-shadow: 0 0 10px rgba(0, 192, 255, 0.7);
}

.skill-tags-container {
  padding: 10px;
  min-height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.skill-tag {
  background-color: rgba(0, 192, 255, 0.2);
  border-color: rgba(0, 192, 255, 0.5);
  color: #00c0ff;
  margin: 5px;
  transition: all 0.3s;
}

.skill-tag:hover {
  transform: scale(1.1);
  background-color: rgba(0, 192, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 192, 255, 0.7);
}

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: #00c0ff;
}
</style>